package com.zwj.service.impl;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zwj.dao.users.UsersMapper;
import com.zwj.entity.Users;
import com.zwj.service.UsersService;

@Service
@Transactional
public class UsersServiceImpl implements UsersService{

	@Autowired
	private UsersMapper usersMapper;
	
	@Override
	public Users selectUsernameAndPassword(@Param("username") String username,@Param("password") String password) {
		Users users = this.usersMapper.selectUsernameAndPassword(username, password);
		return users;
	}

	//修改信息
	@Override
	public boolean updatePassword(Users user) {
		boolean result = this.usersMapper.updatePassword(user);
		return result;
	}

	//查询所有
	@Override
	public List<Users> selectall(Users users) {
		List<Users> u=this.usersMapper.selectall(users);
		return u;
	}

	//依据username查询
	@Override
	public Users selectUsername(String username) {
		Users u=this.usersMapper.selectUsername(username);
		return u;
	}

}
